package com.meilai.project.mapper.administration.goods;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meilai.project.dto.administration.goods.GoodsOutStorageSearchDTO;
import com.meilai.project.entity.administration.goods.GoodsOutStorage;
import com.meilai.project.vo.administration.goods.GoodsOutStorageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GoodsOutStorageMapper extends BaseMapper<GoodsOutStorage> {
    List<GoodsOutStorageVO> selectPageList(Page<GoodsOutStorageVO> page, @Param("query") GoodsOutStorageSearchDTO searchDTO);

    //    @Select("SELECT  a.*,`u`.`name` AS `applyer_name`,`b`.`name` AS `supplier_name`,`c`.`name` AS `goods_name` FROM `goods_out_storage` `a`\n" +
//            "        left join `supplier` `b` on a.`supplier_id`=b.`id`\n" +
//            "        left join `supplier_goods` `c` on a.`supplier_goods_id`=c.`id`\n" +
//            "        left join `user` `u` on a.`flow_applyer_id`=u.`id`\n" +
//            "        where\n" +
//            "        isnull(a.deleted_at) AND a.deleted_at is NULL and a.`id`= #{id}")
    GoodsOutStorageVO selectOneById(@Param("id") Long id);
}
